# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=epiphany
pkgver=40.3
pkgrel=1
pkgdesc="A GNOME web browser based on the WebKit rendering engine"
url="https://wiki.gnome.org/Apps/Web"
arch=(x86_64)
license=(GPL)
depends=(webkit2gtk gcr icu libdazzle libhandy libportal libarchive)
makedepends=(docbook-xml startup-notification lsb-release gobject-introspection
             yelp-tools git meson)
checkdepends=(xorg-server-xvfb aspell hspell hunspell nuspell libvoikko)
groups=(gnome)
_commit=39ea7a27f3dc7f6c45095dcb73ce82e78dc0a4b2  # tags/40.3^0
source=("git+https://gitlab.gnome.org/GNOME/epiphany.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  dbus-run-session xvfb-run \
    -s '-screen 0 1920x1080x24 -nolisten local' \
    meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}
